Skip to content

fix(parser): fix DynamoDB Stream Lambda invocation record model#8321

Open
exg wants to merge 3 commits into
aws-powertools:developfrom
exg:dynamodb-stream-lambda-invocation-record
Open

fix(parser): fix DynamoDB Stream Lambda invocation record model#8321
exg wants to merge 3 commits into
aws-powertools:developfrom
exg:dynamodb-stream-lambda-invocation-record

Conversation

@exg

@exg exg commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Issue number: closes #8322

Summary

The PR fixes an issue in the DynamoDB Stream Lambda Invocation record data model introduced in #7818.

Changes

The responseContext.functionError field of a DynamoDB Stream Lambda Invocation record is null if the error did not occur during function execution.

User experience

Please share what the user experience looks like before and after this change


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@exg exg requested a review from a team as a code owner July 3, 2026 12:09
@exg exg requested a review from leandrodamascena July 3, 2026 12:09
@boring-cyborg boring-cyborg Bot added the tests label Jul 3, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 3, 2026

@leandrodamascena leandrodamascena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and you're right the field is optional.

One thing: I'd make it Optional[str] = Field(default=None, ...). On its own Optional[str] accepts an explicit null but still rejects the field being absent, and AWS tends to just drop these fields rather than send null in some cases. The default covers both. A test for the missing field would round it out, then happy to approve.

exg added 3 commits July 5, 2026 16:48
The responseContext.functionError field is null if the error did not
occur during function execution.
Also add temporary ignores for some upgrade rules, as there are 1017
corresponding errors.
@exg exg force-pushed the dynamodb-stream-lambda-invocation-record branch from 186f42f to dbdcd73 Compare July 5, 2026 13:59
@exg

exg commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, and you're right the field is optional.

One thing: I'd make it Optional[str] = Field(default=None, ...). On its own Optional[str] accepts an explicit null but still rejects the field being absent, and AWS tends to just drop these fields rather than send null in some cases. The default covers both. A test for the missing field would round it out, then happy to approve.

Thanks, updated 👍

I noticed that the ruff target version is behind so I bumped it. After the bump ruff reports 2 B905 errors and 1017 errors from ruff upgrade rules. I fixed the former and added temporary ignores for the latter, to avoid adding noise to the PR. The upgrade errors are automatically fixable, so I can easily fix them in a separate commit if you prefer.

@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event_handlers size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: The DynamoDB Stream Lambda invocation record model rejects valid records

2 participants